package com.example.bootdemo.utils;

import org.apache.commons.codec.digest.DigestUtils;

import java.security.MessageDigest;


public class EncryptionUtil {

    /**
     * md5加密，不带秘钥
     * @param clear
     * @return
     * @throws Exception
     */
    public static String md5Encrypt(String clear)throws Exception{
        //转字符串成密文
        String cipher = DigestUtils.md5Hex(clear);
        return cipher;
    }
}
